from django.db import models

# Create your models here.
from django.utils.timezone import now

from url.models import Urls
from utils.baseModel import BaseModel


class Steps(BaseModel):
    url_id = models.ForeignKey(to=Urls, to_field="id", on_delete=models.CASCADE, verbose_name="url_id",
                               db_column="url_id", related_name="steps")
    file = models.TextField(default=None, null=True)
    query = models.TextField(default=None, null=True)
    body = models.TextField(default=None, null=True)

    class Meta(object):
        db_table = "steps"


class Case(BaseModel):
    info = models.CharField(max_length=200, default=None)
    steps_id = models.ForeignKey(to=Steps, to_field="id", on_delete=models.CASCADE, verbose_name="steps_id",
                                 db_column="steps_id", related_name="case")

    class Meta(object):
        db_table = "case"
        ordering = ('-create_time',)
